C (62/301)

From:Colin Wenzel
Date:26 Aug 99 at 01:32:31
Subject:Re: Re: Array limits?

From: Colin Wenzel <colstv@hotkey.net.au>

On 26-Aug-99, Damir Arh wrote:
>From: Damir Arh <damir.arh@guest.arnes.si>
-snip-
>Thank you for your explanation. I tried it out and that was indeed the
>problem. I am allocating it dinamically and the problem is all sorted out
>(I don't want to rely on the user for setting the stack size).

Check this out then....
----------------------------------------------------
exec.library/StackSwap exec.library/StackSwap

NAME
StackSwap - EXEC supported method of replacing task's stack (V37)

SYNOPSIS
StackSwap(newStack)
A0

VOID StackSwap(struct StackSwapStruct *);

FUNCTION
This function will, in an EXEC supported manner, swap the
stack of your task with the given values in StackSwap.
The StackSwapStruct structure will then contain the values
of the old stack such that the old stack can be restored.
This function is new in V37.

NOTE
If you do a stack swap, only the new stack is set up.
This function does not copy the stack or do anything else
other than set up the new stack for the task. It is
generally required that you restore your stack before
exiting.

INPUTS
newStack - A structure that contains the values for the
new upper and lower stack bounds and the new stack
pointer. This structure will have its values
replaced by those in you task such that you can
restore the stack later.

RESULTS
newStack - The structure will now contain the old stack.
This means that StackSwap(foo); StackSwap(foo);
will effectively do nothing.

SEE ALSO
AddTask(), RemTask(), exec/tasks.h

----------------------------------------------------
Colin Wenzel. Queensland, Australia.
EMAIL: colstv@hotkey.net.au
URL: http://www.hotkey.net.au/~colstv/

'AMIGA' 4000T With CS-III 68060 / 50Mhz 150Mb RAM.
----------------------------------------------------